<?php
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('adminhtml-log-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1><?php echo $this->getActionLabel() ?></h1>

<p>您可以在搜索字符前面加 (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b> 或者 <b>=</b>) 进行搜索</p>

<?php echo CHtml::link('点击高级搜索','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'adminhtml-log-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	//'cssFile'=>Yii::app()->baseUrl. '/css/gridview/grid-view.css',
	//'htmlOptions'=>array('style'=>'margin:0px 10px 5px 10px;'),
	'columns'=>array(
		array(
			'class'=>'CCheckBoxColumn',
		    'id'=>'ids',
			'selectableRows'=>2,
		),
		//'log_id',
		array(
	        'name' => 'log_id',
	        'htmlOptions'=>array('style'=>'width:40px'),
	    ),
		//'action_type',
		array(
	        'name' => 'action_type',
	        'type' => 'raw',
	        'htmlOptions'=>array('style'=>'width:50px'),
			'value' => 'AdminhtmlHelper::getLogTypeLabel( $data->action_type )',
			'filter'=> AdminhtmlHelper::getLogTypeOptions(),
	    ),
		'action_controller',
		'action_model',
		'log_time',
		//'admin_id',
		array(
	        'name' => 'admin_id',
	    	'value' => '$data->admin->username',
		),
		/*
		'action_params',
		'action_info',
		*/
		array(
	        'name' => 'status',
	        'type' => 'raw',
	        'htmlOptions'=>array('style'=>'width:50px'),
			'value' => 'AdminhtmlHelper::getStatusLabel( $data->status )',
			'filter'=> AdminhtmlHelper::getStatusOptions(),
	    ),
		array(
	        'name' => 'remote_addr',
	        'type' => 'raw',
	        'htmlOptions'=>array('style'=>'width:50px'),
			'value' => 'long2ip( $data->remote_addr )',
	    ),
		array(
			'class'=>'CButtonColumn',
			'template'=>'{view} {delete}',
			'headerHtmlOptions'=>array('style'=>'width:40px'),
			'htmlOptions'=>array('style'=>'width:40px'),
		),
	),
)); ?>
